package com.photoeditor.demo.model.bean;

import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;

import com.photoeditor.demo.util.MediaTypeUtil;

public class ThumbnailBean implements Parcelable{
	private String mPath;
	private long mDate;
	private boolean isChecked = false;
	private Uri mUri;
	private int mDegree = 0;
	private int mType = MediaTypeUtil.TYPE_OTHER_IMAGE;
	private long mDuration;

	private int mSelectCount = 0;

	public ThumbnailBean(){
		
	}

	public ThumbnailBean(String path, long date, boolean isChecked, Uri uri, int degree, int type) {
		mPath = path;
		mDate = date;
		isChecked = isChecked;
		mUri = uri;
		mDegree = degree;
		mType = type;
	}

	public ThumbnailBean(Parcel source){
		mPath = source.readString();
		mDate = source.readLong();
		isChecked = source.readInt() == 1 ? true : false;
		mUri = Uri.parse(source.readString());
		mDegree = source.readInt();
		mType = source.readInt();
	}
	
	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(mPath);
		dest.writeLong(mDate);
		dest.writeInt(isChecked ? 1 : 0);
		dest.writeString(mUri.toString());
		dest.writeInt(mDegree);
		dest.writeInt(mType);
	}
	
	public static final Creator<ThumbnailBean> CREATOR = new Creator<ThumbnailBean>() {
		
		@Override
		public ThumbnailBean[] newArray(int size) {
			return new ThumbnailBean[size];
		}
		
		@Override
		public ThumbnailBean createFromParcel(Parcel source) {
			return new ThumbnailBean(source);
		}
	};

	public String getPath() {
		return mPath;
	}

	public void setPath(String mPath) {
		this.mPath = mPath;
	}

	public long getDate() {
		return mDate;
	}

	public void setDate(long mDate) {
		this.mDate = mDate;
	}

	public boolean isChecked() {
		return isChecked;
	}

	public void setChecked(boolean isChecked) {
		this.isChecked = isChecked;
	}

	public Uri getUri() {
		return mUri;
	}

	public void setUri(Uri mUri) {
		this.mUri = mUri;
	}

	public int getDegree() {
		return mDegree;
	}

	public void setDegree(int mDegree) {
		this.mDegree = mDegree;
	}

	public int getType() {
		return mType;
	}

	public void setType(int mType) {
		this.mType = mType;
	}

	public int getSelectCount() {
		return mSelectCount;
	}

	public void setSelectCount(int selectCount) {
		mSelectCount = selectCount;
	}

	public long getDuration() {
		return mDuration;
	}

	public void setDuration(long duration) {
		this.mDuration = duration;
	}
}
